const API = require('@/api/base')

const getSiteInfo = function(data) {
	return API.get('/wp-json/mp/v2/setting', data);
}


/**
 * 获取用户信息
 * @param  {object} args 参数
 * @return {promise}
 */
const getProfile = function(e) {
	return API.getUserInfo(e);
}
/*
// #ifdef MP-WEIXIN
	// return API.get('/wp-json/mp/v2/banner/wechat');
	// #endif
	// #ifdef MP-QQ
	// return API.get('/wp-json/mp/v2/banner/qq');
	// #endif
	// #ifdef MP-BAIDU
	// return API.get('/wp-json/mp/v2/banner/baidu');
	// #endif
	// #ifdef MP-TOUTIAO
	// return API.get('/wp-json/mp/v2/banner/toutiao');
	// #endif
	// #ifndef MP
	// return API.get('/wp-json/mp/v2/banner/wechat');
	// #endif
*/

const getBanner = function() {

	var result =  API.get("/miss/banner/getBannerList/unauth")
	return result;
}
const getSpotStatus = function(data) {

	var result =  API.get("/miss/spot/putSpotStatus",data)
	return result;
}

const putSpot = function(data) {

	var result =  API.post("/miss/spot/putSpot",data,{token:false})
	return result;
}
const getSpot = function(data) {

	var result =  API.get("/miss/spotPool/getSpot",data)
	return result;
}
const getMineSpot = function(data) {
	
	var result =  API.get("/miss/mineSpot/page",data)
	return result;
}
const loginByCode = function(data) {
	
	var result =  API.get("/miss/member/loginByCode",data)
	return result;
}
const sendCode = function(data) {
	
	var result =  API.get("/miss/member/sendCode",data)
	return result;
}
const saveSpot = function(data) {
	
	var result =  API.post("/miss/spot/saveSpot",data,{token:false})
	return result;
}

API.getBanner = getBanner
API.getSpotStatus=getSpotStatus
API.putSpot=putSpot
API.getSpot=getSpot
API.getMineSpot=getMineSpot
API.saveSpot=saveSpot
API.loginByCode=loginByCode
API.sendCode=sendCode

module.exports = API
